<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>塔罗</title>
	 
	<link href="static/bootstrap.3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"> 
	<script src="https://images.robustcn.com/public/static/module/common/jquery/jquery-2.2.3.min.js"></script>
	
	<script src="static/bootstrap.3.3.7/js/bootstrap.min.js"></script> 
</head>
<body>
<div class="container">
	<table class="table table-bordered">
					<tbody>
					<tr>
						<th class="text-center"><div class="col-md-6 col-md-push-3">
								<button class="btn btn-primary paizhen">排阵</button>
							</div></th>
						<td class="text-center">
							<div class="col-md-6 col-md-push-3">
								 <ul class='order_number'>
								 
								 </ul>
							</div>
						</td>
					</tr>
					<tr>
						<th class="text-center"><div class="col-md-6 col-md-push-3">
								<button class="btn btn-primary jiexi">解析</button>
							</div></th>
						<td class="text-center">
						
						<div class="row">
  <div class="col-xs-1">
    id
  </div>
  <div class="col-xs-3">
    <input type="text" class="form-control id" >
  </div>
  <div class="col-xs-2">
   order_number
  </div>
  <div class="col-xs-4">
    <input type="text" class="form-control order_number">
  </div>
</div>
						
						
						
						</td>
					</tr>
					</tbody>
					
				</table>
				<div class="bs-example jieshi_html" data-example-id="simple-address">
 
               </div>
</div>
 
</body>
</html> 


<script>

    
    $(document).ready(function () {
    
	var w_t_s={'title':'标题','explain':'解读','figure_front':'正人物','work_front':'正工作','love_front':'正爱情','friend_front':'正友情','affection_front':'正亲情','figure_inversion':'逆人物','work_inversion':'逆工作','love_inversion':'逆爱情','affection_inversion':'逆亲情'}
        $(".paizhen").on("click", function () {
		    $.ajax({
                type: "POST",
                url: "http://adminxg.robustcn.com/appraise/waitetarotlog/waitetarotlogadd",
                data: {'access_token': '1*#wx7c432da20b3b41bc','openid':'abcd123456'},
                success: function (result) {
                     console.log(result.data);
					 $('.order_number').html('<li>id:'+result.data.id+'</li><li>order_number:'+result.data.order_number+'</li><li>t_id:'+result.data.t_number+'</li><li>p_n:'+result.data.p_n+'</li>');
					 $('.id').attr("value",result.data.id);
					 $('.order_number').attr("value",result.data.order_number);
                },
                error: function (e) {
                    alert('请求异常');
                }
            });
        });
		
		
		 $(".jiexi").on("click", function () {
		    $.ajax({
                type: "POST",
                url: "http://adminxg.robustcn.com/appraise/waitetarotlog/waitetarotloginfo",
                data: {'access_token': '1*#wx7c432da20b3b41bc','id':$('.id').attr("value"),'order_number':$('.order_number').attr("value")},
                success: function (result) {
                   
					 if(result.code==0){
					 var dfg=result.data['corpus'];
					 var jieshi='';
					   for (var i in dfg) {
					      for (var p in dfg[i]) {
						  if(w_t_s[p]){
						     jieshi+='<address><strong>'+w_t_s[p]+'</strong><br/>'+dfg[i][p]+'</address>';
						  }
						  if(p=='title'){
                              jieshi+='<img src="static/img/'+dfg[i]['id']+'.jpg">';
						  }
						 }
					   }
					   $('.jieshi_html').html(jieshi);
					   
					 }else{
					 alert(result.msg);
					 }
					 
                },
                error: function (e) {
                    alert('请求异常');
                }
            });
        });
    });
    
</script>



